<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #d1{
            width: 100px;
            height: 50px;
            background-color: red;
            position: absolute;
            z-index: 8;
        }
        #d2{
            width: 50px;
            height: 100px;
            background-color: blue;
            position: absolute;
            /*
            当元素为非static定位时,可能出现层叠问题,
            通过z-index的值控制显示的顺序,值越大显示越靠前
            如果值相同则后执行的显示在前面
            */
            z-index: 7;
        }
    </style>
</head>
<body>
<div id="d1"></div>
<div id="d2"></div>
</body>
</html>